<template>
  <a-layout>
    <a-layout-header class="header">
      <!-- <div class="logo" />
          <a-menu v-model:selectedKeys="selectedKeys1" theme="dark" mode="horizontal" :style="{ lineHeight: '64px' }">
              <a-menu-item key="1">nav 1</a-menu-item>
              <a-menu-item key="2">nav 2</a-menu-item>
              <a-menu-item key="3">nav 3</a-menu-item>
          </a-menu> -->
      <div class="left">左</div>
      <div class="center">欢迎来到我的世界</div>
      <div class="right">右</div>
    </a-layout-header>
    <a-layout class="main">
      <a-layout-sider class="leftMenu" style="background: #fff">
        <a-menu v-model:selectedKeys="selectedKeys" v-model:openKeys="openKeys" mode="inline"
          :style="{ height: '100%', borderRight: 0 }" @click="jumpItem">
          <a-sub-menu key="sub1">
            <template #title>
              <span>
                <user-outlined />
                subnav 1
              </span>
            </template>
            <a-menu-item key="1">option1</a-menu-item>
            <a-menu-item key="2">option2</a-menu-item>
            <a-menu-item key="3">option3</a-menu-item>
            <a-menu-item key="4">option4</a-menu-item>
          </a-sub-menu>
          <a-sub-menu key="sub2">
            <template #title>
              <span>
                <laptop-outlined />
                subnav 2
              </span>
            </template>
            <a-menu-item key="5">option5</a-menu-item>
            <a-menu-item key="6">option6</a-menu-item>
            <a-menu-item key="7">option7</a-menu-item>
            <a-menu-item key="8">option8</a-menu-item>
          </a-sub-menu>
          <a-sub-menu key="sub3">
            <template #title>
              <span>
                <notification-outlined />
                subnav 3
              </span>
            </template>
            <a-menu-item key="9">option9</a-menu-item>
            <a-menu-item key="10">option10</a-menu-item>
            <a-menu-item key="11">option11</a-menu-item>
            <a-menu-item key="12">option12</a-menu-item>
          </a-sub-menu>
        </a-menu>
      </a-layout-sider>
      <a-layout class="rightContain">
        <a-breadcrumb style="margin: 6px 0">
          <a-breadcrumb-item>{{ useroute.meta.menuName }}</a-breadcrumb-item>
          <!-- <a-breadcrumb-item>List</a-breadcrumb-item>
          <a-breadcrumb-item>App</a-breadcrumb-item> -->
        </a-breadcrumb>
        <a-layout-content :style="{ background: '#fff', padding: '12px', margin: 0, minHeight: '280px' }">
          <router-view></router-view>
        </a-layout-content>
      </a-layout>
    </a-layout>
  </a-layout>
</template>
<script setup>
import { ref } from 'vue';
const selectedKeys = ref(['1']);
const openKeys = ref(['sub1']);
import { UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons-vue';
import { useRoute, useRouter } from 'vue-router';
const useroute = useRoute()
const userouter = useRouter()








const jumpItem = (item, key, keyPath) => {
  console.log(item, key, keyPath);

  console.log(useroute, 'useroute');
  console.log(userouter, 'userouter');

  userouter.push('/about')
}
</script>
<style scoped lang="less">
#components-layout-demo-top-side-2 .logo {
  float: left;
  width: 120px;
  height: 31px;
  margin: 16px 24px 16px 0;
  background: rgba(255, 255, 255, 0.3);
}

.ant-row-rtl #components-layout-demo-top-side-2 .logo {
  float: right;
  margin: 16px 0 16px 24px;
}

.site-layout-background {
  background: #fff;
}

.ant-layout-header {
  padding: 0;
}

.header {
  background: #1677ff;
  display: flex;
  align-items: center;
  height: 6%;
  // line-height: 50px;

  .left {
    width: 13%
  }

  .center {
    width: 67%;
    text-align: center;
  }

  .right {
    width: 20%
  }
}



.ant-layout {
  height: 100%;

  .main {
    width: 100%;
    height: 94%;
  }

  .leftMenu {
    width: 10% !important;
    overflow: auto;
  }

  .rightContain {
    width: 86% !important;
    padding: 0 8px 8px;
  }
}
</style>